package com.zhaokuo.aop;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Before;

/**
 * @author kuo 2011-9-26
 *
 */
@org.aspectj.lang.annotation.Aspect
public class Aspect {
	public void logger(JoinPoint joinPoint) {
		Object[] args = joinPoint.getArgs();
		for (int i = 0; i < args.length; i++) {

			System.out.println("method arg" + i + " -- " + args[i]);
		}
		
		 System.out.println(joinPoint.getSignature().getName());
		 
		 System.out.println("----logging-----");   
	}
	
	
	public void getmes(){
		System.out.println("-----------getmes-------");
	}
	
	@Before("execution(* com.zhaokuo.service.impl.UserServiceImpl.select())")
	public void getms(JoinPoint joinPoint){
		Object[] args = joinPoint.getArgs();
		for (int i = 0; i < args.length; i++) {

			System.out.println("method arg" + i + " -- " + args[i]);
		}
		
		 System.out.println(joinPoint.getSignature().getName());
		 
		 System.out.println("----getms-----");  
	}
}
